package tgc.edu.exam.repository;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import tgc.edu.exam.custom.CommonRepository;
import tgc.edu.exam.entity.SysUser;


@Repository
public interface SysUserRepository extends CommonRepository<SysUser, Integer>{

	SysUser findByUsername(String username);

	SysUser findByUsernameAndPassword(String username, String password);

	@Transactional
	@Modifying
	@Query(value="UPDATE sys_user SET password=?1 WHERE id=?2",nativeQuery=true)
	void editPwd(String encode, Integer id);

	
}
	
